<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/1
 * Time: 14:40
 */
namespace Controller;

use Model\IndexModel;
use Shop\Controller;

class TooController extends Controller{
    public $model='';
    public function __construct()
    {
        parent::__construct(); //执行父类
        /****头部****/
        //读取网站设置
        $this->model=new IndexModel();
        $set=$this->model->getW();
        if($set['wstat']!='1'){
            exit('网站管理，联系管理员。。。。。');
        }
        //分类
        $fl=$this->model->pdo_sel("select * from sh_fl order by sort desc",2);
        //得到分类项目的6个商品
        foreach($fl as &$v){
            $v['goods']=$this->model->pdo_sel("select * from sh_goods where f_id = '{$v['id']}' limit 6",2);
        }

        $this->view->assign('fl',$fl);
        $this->view->assign('set',$set);

    }
}